
function joinPath {
    # 拼接路径
    Join-Path "C:/yy" "xx/xxx.txt"
}


# 测试目录/文件是否存在
function checkExist {
    Test-Path C:\Scripts\Archive

    $file = "E:\psd.docx1"
    if (-not (Test-Path $file)) {
        Write-Host "[" $file "] not exist"
    }else {
        Write-Host $file "exist"
    }
    
}

function getParent {
    # 获取父目录
    $scriptPath = "C:\Scripts\Archive"
    $parentPath = Split-Path -parent $scriptPath
    $parentPath
}

function getTailN {
    # 获取最后三行
    $result = Get-Content E:\user.xml -Tail 3
    foreach ($item in $result) {
        $item + "1"
    }
}

getTailN